# -*- coding: utf-8 -*-
# !/usr/bin/env python
# @ author = 'zoushunli'
# @ author_email = '409358374@qq.com'
from bs4 import BeautifulSoup
import requests
import random
import pprint
from multiprocessing import Pool
import scrapy

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver import ActionChains
from pyquery import PyQuery as pq
from time import sleep
import you_get

from DecryptLogin import login



class BilibiliInfo(object):
    userInfoDict = {
        'username': '409358374@qq.com',
        'password': 'zou409358374',
        'SESSDATA': '428ecfea%2C1605283251%2C083eb*51',
        'bili_jct': '4f70e00bc01a6f45f038e6e09e66a54d',
    }




import you_get








def download_video():
    user_agent = [
    'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36',
    'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0'
    ]

    headers = {
        'User-Agent': random.choice(user_agent),
        'cookie': "CURRENT_FNVAL=16; _uuid=0BEF7D79-7490-0CC3-2F59-5F83C15D7C4F99696infoc; buvid3=6EE77367-478E-45B4-A7E8-FCE070A37A54155805infoc; LIVE_BUVID=AUTO4015842669702850; rpdid=|(J|)J|Jku|k0J'ul)RkYYm~u; DedeUserID=3729202; DedeUserID__ckMd5=092920f33d03c072; SESSDATA=dfc132a9%2C1600180154%2Cffee4*31; bili_jct=83187c1bc920ce98fac5110fb2cf75c0; CURRENT_QUALITY=80; PVID=4; bp_t_offset_3729202=385058584187546025; bp_video_offset_3729202=390010544042835040; sid=iq4bz4g8; INTVER=1; bsource=seo_baidu; bfe_id=61a513175dc1ae8854a560f6b82b37af",
    }

    url = 'https://space.bilibili.com/15960317/video'
    r = requests.get(url=url, headers=headers)
    r.encoding = "UTF-8"
    html = r.text
    # html = r.content
    print(html)
    # soup = BeautifulSoup(r.text, 'lxml')
    # data = r.text
    # pprint.pprint(data)


def main():
    # pool = Pool(20)
    # for i in (1500):
    #     pool.apply_async(download_video, (i, ))
    # pool.close()
    # pool.join()
    # username = '409358374@qq.com'
    # password = 'zou409358374'
    # lg = login.Login()
    # infos_return, session = lg.bilibili(username, password)
    download_video()



if __name__ == '__main__':
    main()
